package com.snails.mall.elasticsearch.biz.common.dao;

import org.springframework.core.io.Resource;

import java.io.IOException;

/**
 * @author gaoxu
 * date: Created on 2021/11/9 上午10:24
 */
public interface ElasticsearchDao {

    /**
     * 判断索引是否存在
     *
     * @param indexName
     * @return
     * @throws IOException
     */
    Boolean indexExistFlag(String indexName) throws IOException;

    /**
     * 创建索引
     *
     * @param indexName             索引名称
     * @param aliasName
     * @param mappingResource
     * @return
     * @throws IOException
     */
    Boolean createIndex(String indexName, String aliasName, Resource mappingResource) throws IOException;
}
